<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Manage subscribable mailing list</title>
        <link rel="stylesheet" type="text/css" href="./css/markdown.css" />
    </head>
    <body>

    <div id="navigation">
    <a href="https://www.iredmail.org" target="_blank">
        <img alt="iRedMail web site"
             src="./images/logo-iredmail.png"
             style="vertical-align: middle; height: 30px;"
             />&nbsp;
        <span>iRedMail</span>
    </a>
    &nbsp;&nbsp;//&nbsp;&nbsp;<a href="./index.html">Document Index</a></div><h1 id="manage-subscribable-mailing-list">Manage subscribable mailing list</h1>
<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>Check out the lightweight on-premises email archiving software developed by iRedMail team: <a href="https://spiderd.io/">Spider Email Archiver</a>.</p>
</div>
<div class="toc">
<ul>
<li><a href="#manage-subscribable-mailing-list">Manage subscribable mailing list</a><ul>
<li><a href="#summary">Summary</a></li>
<li><a href="#default-settings-on-iredmail-server">Default settings on iRedMail server</a></li>
<li><a href="#manage-mailing-lists-with-command-line-tools">Manage mailing lists with command line tools</a><ul>
<li><a href="#create-a-mailing-list">Create a mailing list</a></li>
<li><a href="#view-mailing-list-settings">View mailing list settings</a></li>
<li><a href="#update-an-existing-mailing-list">Update an existing mailing list</a></li>
<li><a href="#delete-an-existing-mailing-list">Delete an existing mailing list</a></li>
<li><a href="#list-all-memberssubscribers">List all members/subscribers</a></li>
<li><a href="#check-whether-mailing-list-has-given-membersubscriber">Check whether mailing list has given member/subscriber</a></li>
<li><a href="#check-all-subscribed-mailing-lists-of-a-given-membersubscriber">Check all subscribed mailing lists of a given member/subscriber</a></li>
</ul>
</li>
<li><a href="#how-to-subscribe-to-or-unsubscribe-from-a-mailing-list">How to subscribe to or unsubscribe from a mailing list</a></li>
</ul>
</li>
</ul>
</div>
<h2 id="summary">Summary</h2>
<p>iRedMail-0.9.8 integrates <a href="http://mlmmj.org">mlmmj</a> as mailing list manager.
"Although it doesn't aim to include every feature possible, but focuses on
staying mean and lean, and doing what it does do well, it does have a great
set of features, including:"</p>
<ul>
<li>Archive</li>
<li>Custom headers / footer</li>
<li>Fully automated bounce handling (similar to ezmlm)</li>
<li>Complete requeueing functionality</li>
<li>Moderation functionality</li>
<li>Subject prefix</li>
<li>Subscribers only posting</li>
<li>Regular expression access control</li>
<li>Functionality to retrieve old posts</li>
<li>Digests</li>
<li>No-mail subscription</li>
<li>VERP support</li>
<li>Delivery Status Notification (RFC1891) support</li>
<li>Rich, customisable texts for automated operations</li>
</ul>
<p>For more details about mlmmj, please visit <a href="http://mlmmj.org">mlmmj website</a>.</p>
<h2 id="default-settings-on-iredmail-server">Default settings on iRedMail server</h2>
<ul>
<li>mlmmj doesn't have a global config file.</li>
<li>Data (archive, configurations, etc) of mailing lists are stored under
  <code>/var/vmail/mlmmj</code> by default. For example: mailing list <code>newsletter@mydomain.com</code>:<ul>
<li>Archived messages are stored under <code>/var/vmail/mlmmj/mydomain.com/newsletter/archive/</code>.</li>
<li>Normal subscribers are stored under
  <code>/var/vmail/mlmmj/mydomain.com/newsletter/subscribers.d/</code>, file <code>a</code> under
  this directory contains all subscribers whose email addresses start with
  letter <code>a</code>.</li>
</ul>
</li>
</ul>
<h2 id="manage-mailing-lists-with-command-line-tools">Manage mailing lists with command line tools</h2>
<p>iRedMail team develops a HTTP RESTful API server called <code>mlmmjadmin</code> to help
manage mlmmj mailing lists:</p>
<ul>
<li>It's installed under <code>/opt/mlmmjadmin</code>, which is a symbol link to
  <code>/opt/mlmmjadmin-&lt;version&gt;</code>.</li>
<li>It listens on address <code>127.0.0.1</code>, port <code>7779</code> by default.</li>
<li>It's written in Python programming language, full source code is
  hosted on github: <a href="https://github.com/iredmail/mlmmjadmin">https://github.com/iredmail/mlmmjadmin</a>. Feel free to fork
  it and send us pull requests to improve it.</li>
</ul>
<h3 id="create-a-mailing-list">Create a mailing list</h3>
<p>Let's say you have mail domain <code>mydomain.com</code> hosted on iRedMail server,
now let's create mailing list <code>newsletter@mydomain.com</code> from command line:</p>
<pre><code>cd /opt/mlmmjadmin/tools/
python maillist_admin.py create newsletter@mydomain.com
</code></pre>
<p>You can create mailing list with extra options, for example:</p>
<pre><code>python maillist_admin.py create newsletter@mydomain.com name='Support Team' disable_archive=no
</code></pre>
<ul>
<li>All options are listed in file <code>/opt/mlmmjadmin/docs/API.md</code> on your server.</li>
<li>You can specify as many (different) options as you want.</li>
</ul>
<h3 id="view-mailing-list-settings">View mailing list settings</h3>
<p>To view mailing list settings, use the <code>info</code> argument like below:</p>
<pre><code>python maillist_admin.py info newsletter@mydomain.com
</code></pre>
<h3 id="update-an-existing-mailing-list">Update an existing mailing list</h3>
<p>To update existing mailing list, use the <code>update</code> argument like below:</p>
<pre><code>python maillist_admin.py update newsletter@mydomain.com name='Updated name' disable_archive=yes
</code></pre>
<p>All options are listed in file <code>/opt/mlmmjadmin/docs/API.md</code> on your server.</p>
<h3 id="delete-an-existing-mailing-list">Delete an existing mailing list</h3>
<p>To delete an existing mailing list, use the <code>delete</code> argument like below:</p>
<pre><code>python maillist_admin.py delete newsletter@mydomain.com
</code></pre>
<h3 id="list-all-memberssubscribers">List all members/subscribers</h3>
<p>To delete an existing mailing list, use the <code>subscribers</code> argument like below:</p>
<pre><code>python maillist_admin.py subscribers newsletter@mydomain.com
</code></pre>
<h3 id="check-whether-mailing-list-has-given-membersubscriber">Check whether mailing list has given member/subscriber</h3>
<p>To check whether mailing list has given member/subscriber, use the
<code>has_subscriber</code> argument like below:</p>
<pre><code>python maillist_admin.py has_subscriber newsletter@mydomain.com subscriber@gmail.com
</code></pre>
<h3 id="check-all-subscribed-mailing-lists-of-a-given-membersubscriber">Check all subscribed mailing lists of a given member/subscriber</h3>
<p>To check all subscribed mailing lists of a given member/subscriber, use the
<code>subscribed</code> argument like below:</p>
<pre><code>python maillist_admin.py subscribed subscriber@gmail.com
</code></pre>
<h2 id="how-to-subscribe-to-or-unsubscribe-from-a-mailing-list">How to subscribe to or unsubscribe from a mailing list</h2>
<ul>
<li>
<p>To subscribe to mailing list <code>newsletter@mydomain.com</code>, simply send an email
  to address <code>newsletter+subscribe@mydomain.com</code> (content of mail subject and
  body don't matter at all), you will receive an email for subscription
  confirmation. Simply reply the confirm email with any subject/body will
  confirm your subscription.</p>
</li>
<li>
<p>To unsubscribe from mailing list <code>newsletter@mydomain.com</code>, simply send an
  email to address <code>newsletter+unsubscribe@mydomain.com</code> (content of mail
  subject and body don't matter at all), you will receive an email for
  unsubscription confirm, simply reply the confirm email with any subject/body
  will confirm your unsubscription.</p>
</li>
</ul><div class="footer">
    <p style="text-align: center; color: grey;">All documents are available in <a href="https://github.com/iredmail/docs/">GitHub repository</a>, and published under <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">Creative Commons</a> license. You can <a href="https://github.com/iredmail/docs/archive/master.zip">download the latest version</a> for offline reading. If you found something wrong, please do <a href="https://www.iredmail.org/contact.html">contact us</a> to fix it.</p>
</div></body></html>